1. Field of the Invention
The present invention relates to distributed computing systems. More specifically, the present invention relates to a method and an apparatus for synchronizing caches in a distributed computing system using a peer-to-peer refreshing mechanism.
2. Related Art
As computer networks continue to proliferate, it is becoming progressively easier for geographically distributed computer systems to work together in performing computational tasks. Historically, such cooperation has been restricted by significant delays and bandwidth limitations involved in communicating between geographically distributed computer systemsxe2x80x94which may possibly be separated by thousands of miles.
However, as the networking infrastructure continues to improve, these delays and bandwidth limitations have been dramatically reduced. This makes it possible for a distributed application to effectively operate on a set of geographically distributed computing nodes in the same way as a distributed application operates on a set of local computing nodes in a local cluster.
However, synchronizing activities between geographically distributed computing nodes can be very challenging. In particular, resolving cache coherence issues between geographically distributed computing nodes can be problematic. Cache coherence issues arise whenever multiple caches can potentially contain the same data item. If a copy of the data item is updated in one cache, other copies of the data item in other caches become stale and must somehow be invalidated (or updated). Existing techniques for performing invalidation (or updating) operations are unacceptably slow in distributed computing systems that span a set of geographically distributed computing nodes.
What is needed is a method and an apparatus that facilitates cache coherence between caches that are distributed across a set of geographically distributed computing nodes.
One embodiment of the present invention provides a system for synchronizing a cache in a computer system through a peer-to-peer refreshing operation. During operation, the system determines the age of an entry in the cache. If the age of the entry exceeds a life span for the entry, the system invalidates the entry in the cache. The system subsequently refreshes the entry by retrieving an updated version of the entry from a peer of the computer system, if possible, instead of from a centralized source for the entry.
In a variation on this embodiment, determining the age of the entry involves determining the age of the entry with reference to a time value extracted from a Global Positioning System (GPS) signal.
In a variation on this embodiment, the system determines the life span for the entry based upon a taxonomy of data that associates different life spans with different types of data.
In a variation on this embodiment, refreshing the entry involves waiting until the entry is accessed again before retrieving the updated version of the entry.
In a variation on this embodiment, refreshing the entry involves automatically refreshing the entry without waiting until the entry is accessed again.
In a variation on this embodiment, refreshing the entry involves attempting to retrieve the updated version of the entry from a first-order peer, which is part of the same peer group as the computer system. If the updated version of the entry cannot be retrieved from a first-order peer, the system attempts to retrieve the updated version of the entry from a second-order peer, which is accessible through a first order peer.
In a variation on this embodiment, if the updated version of the entry cannot be retrieved from a peer of the computer system, the system retrieves the updated version of entry from the centralized source for the entry.
In a variation on this embodiment, if a given peer of the computer system subsequently requests the updated version of the entry, the system supplies the updated version of the entry to the given peer.
In a variation on this embodiment, retrieving the updated version of the entry involves using a Juxtapose (JXTA) framework to facilitate peer-to-peer communications to retrieve the entry.